package com.mxx.democharts2.support;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * Restful接口的统一返回
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)  //为null的属性不参与序列化（json转换）
public class RestResponse {

    private Integer code = 20000;
    private Object data;
    private String message;

    public RestResponse() {
    }

    public RestResponse(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }

    public RestResponse(Object data) {
        this.data = data;
    }
}
